let url = project + '/onlineArchive/report/transferList';
Axios.defaults.baseURL = url;

let main ={
    el:"#app",
    data:function() {
        return {
            list:[],
            loading:false,
        }
    },
    beforeMount:function(){
        this.init();
    },
    computed: {
        // 计算属性的 getter
        tableHeight: function () {
            return 700;
        }
    },
    methods:{
        init:function(){
            this.getData();
        },
        /**
         * 获取分部数据
         */
        getData:function(){
            let that = this;
            that.loading = true;
            Axios.get('/list',{
                timeout: 60000,
            })
                .then(function (response) {
                    console.log(response);
                    that.loading = false;
                    if (response.code != 0){
                        noticeDataRequestFailure(that);
                        return;
                    }
                    that.list = response.data;
                })
                .catch(function (error) {
                    noticeFailure(that);
                    that.loading = false;
                });
        },
        /**
         * 获取分部下门店数据
         * @param tree
         * @param treeNode
         * @param resolve
         */
        load:function(tree, treeNode, resolve) {
            let that = this;
            Axios.get('/load',{
                params:{divisionCode:tree.divisionCode}
            })
                .then(function (response) {
                    console.log(response);
                    if (response.code != 0){
                        noticeDataRequestFailure(that);
                        return;
                    }
                    resolve(response.data)
                })
                .catch(function (error) {
                    noticeFailure(that);
                });
        },
        /**
         * 下载门店移交清单
         * @param row
         */
        downloadStoreTransferList:function(){
            window.location.href = url + '/download/store';
        },
        /**
         * 下载分部移交清单
         * @param row
         */
        downloadDivisionTransferList:function(){
            window.location.href = url + '/download/division';
        },
    }
};
new Vue(main);